//判断广告跳转类型
const checkAdType = item => {
	console.log(item)
	switch (item.android_class) {
		case 'TaobaoActivity':
			//淘宝客
			uni.navigateTo({
				url: '/pages/taobao/index'
			})
			break;
		case 'DialphoneActivity':
			//拨号
			uni.switchTab({
				url: '/pages/call/index'
			})
			break;
		case 'CateListActivity':
			//分类商品
			if(item.param_id) {
				uni.navigateTo({
					url: '/pages/category/goods?id='+item.param_id+'&title='+item.name
				})
			}
			break;
		case 'ICMyThingsCardViewController':
			//物联卡
			break;
		case 'WZGWShopDetailViewController':
			//商品详情
			if(item.param_id) {
				uni.navigateTo({
					url:'/pages/goods/detail?id='+item.param_id
				})
			}
			break;
		case 'WebviewActivity':
			//网页
				if(item.login == 1) {
					var token = uni.getStorageSync('token');
					item.url = item.url + token;
				}
				uni.navigateTo({
					url:'/pages/index/web?detailDate=' + encodeURIComponent(JSON.stringify(item))
				})
			break;
		case 'NTalkerChatViewController':
			//小能客服
			break;
		case 'PointShopController':
			//积分商城
			break;
		case 'RecommendController':
			//我要推荐
			break;
		case 'PddShopViewController':
			//拼多多
			uni.navigateTo({
				url: '/pages/pdd/index'
			})
			break;
		case 'JdShopViewController':
				//京东
				uni.navigateTo({
					url: '/pages/jd/index'
				})
				break;
		case 'SpikeGoodsController':
			//秒杀商品
			uni.navigateTo({
				url: '/pages/goods/spike'
			})
			break;
		case 'GroupGoodsController':
			//团购商品
			uni.navigateTo({
				url: '/pages/group/index'
			})
			break;
		case 'InputCenterActivity':
			//充值中心
			uni.navigateTo({
				url: '/pages/recharge/recharge'
			})
			break;	
		case 'AliHbViewController':
			//支付宝红包
			uni.navigateTo({
				url: '/pages/ali/hb?detailDate=' + encodeURIComponent(JSON.stringify(item))
			})
			break;	
		case 'NewBlockViewController':
			//拉新专区
			uni.navigateTo({
				url:'/pages/activity/index'
			})
			break;
		default:
			break;
	}
}

module.exports = {
	checkAdType
}
